package com.gesis.entity;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * GesClassification entity. 
 * @author Juan Pablo Pazmin
 */
@Entity
@Table(name = "ges_classification")
public class GesClassification implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	// Fields

	private Long claIdClassification;
	private String claDescClassification;
	private String claEstate;
	private Set<GesSubClassification> gesSubClassifications = new HashSet<GesSubClassification>(
			0);

	// Constructors

	/** default constructor */
	public GesClassification() {
	}

	/** minimal constructor */
	public GesClassification(Long claIdClassification,
			String claDescClassification, String claEstate) {
		this.claIdClassification = claIdClassification;
		this.claDescClassification = claDescClassification;
		this.claEstate = claEstate;
	}

	/** full constructor */
	public GesClassification(Long claIdClassification,
			String claDescClassification, String claEstate,
			Set<GesSubClassification> gesSubClassifications) {
		this.claIdClassification = claIdClassification;
		this.claDescClassification = claDescClassification;
		this.claEstate = claEstate;
		this.gesSubClassifications = gesSubClassifications;
	}

	// Property accessors
	@Id
	@Column(name = "cla_id_classification", unique = true, nullable = false)
	public Long getClaIdClassification() {
		return this.claIdClassification;
	}

	public void setClaIdClassification(Long claIdClassification) {
		this.claIdClassification = claIdClassification;
	}

	@Column(name = "cla_desc_classification", nullable = false, length = 200)
	public String getClaDescClassification() {
		return this.claDescClassification;
	}

	public void setClaDescClassification(String claDescClassification) {
		this.claDescClassification = claDescClassification;
	}

	@Column(name = "cla_estate", nullable = false, length = 2)
	public String getClaEstate() {
		return this.claEstate;
	}

	public void setClaEstate(String claEstate) {
		this.claEstate = claEstate;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "gesClassification")
	public Set<GesSubClassification> getGesSubClassifications() {
		return this.gesSubClassifications;
	}

	public void setGesSubClassifications(
			Set<GesSubClassification> gesSubClassifications) {
		this.gesSubClassifications = gesSubClassifications;
	}

}